package org.microservice.system.utils.dto;

import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;
import org.microservice.common.bean.DepartmentVo;
import org.microservice.common.util.TreeNode;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: 齐丹枫
 * Date: 2018/7/11
 * Time: 16:11
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Data
public class DepartmentTree extends TreeNode{
    private int id;
    private String name;
    private String code;
    private int parentId;
    private boolean disabled;
    private int orderNum;
    private String createdBy;
    private String createdTime;
    private String lastModifiedBy;
    private String lastModifiedTime;

    private List leaders = new ArrayList<>();

    public DepartmentTree() {
    }

    public DepartmentTree(DepartmentVo departmentVo) {
        try {
            BeanUtils.copyProperties(this,departmentVo);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }




}
